package com.yunhe.transfer.client;

import com.yunhe.transfer.client.fallback.DeviceFallbackFactory;
import com.yunhe.common.model.ResultObject;
import com.yunhe.common.model.device.Analog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author liuronglei
 */
@ApiIgnore
@FeignClient(value = "yh-device", fallbackFactory = DeviceFallbackFactory.class)
@Component
public interface DeviceClient {


    /**
     * 根据电站代码获得点表列表
     */
    @RequestMapping(value = "/analogs/byStationCode", method = RequestMethod.GET)
    ResponseEntity<ResultObject<List<Analog>>> search(@RequestParam("stationCode") Long stationCode,
                                                      @RequestParam("virtual") Boolean virtual);

    @RequestMapping(value = "/analogs/isNeedStorage", method = RequestMethod.GET)
    ResultObject<List<Long>> getNeedStorageAnalogs(@RequestParam("needStorage") Boolean needStorage);
}
